package com;


import com.mapper.UsersMapper;
import com.pojo.Users;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;
import util.MybatisUtils;


public class UsersTest {
    @Test
    public void findUserTest() {
        SqlSession sqlSession = MybatisUtils.getSession();
        Users users = sqlSession.selectOne("com.mapper.UsersMapper.findUserWithOrders", 1);
        System.out.println(users);
        sqlSession.close();
    }
    @Test
    public void selectUserByIdTest() {
        SqlSession session = MybatisUtils.getSession();
        UsersMapper mapper = session.getMapper(UsersMapper.class);
        Users users = mapper.selectUserById(1);
        System.out.println(users.toString());
        session.close();
    }
}
